<if condition="$readonly">
    <div class="{$class}">{$value}</div>
<else />
    <if condition="$type eq 'num'">
        <input type="number" name="{$name}" class="{$class|default='layui-input'}" value="{$value}" {$other} />
    <elseif condition="$type eq 'string'"/>
        <input type="text" name="{$name}" class="{$class|default='layui-input'}" value="{$value}" {$other} />
    <elseif condition="$type eq 'password'"/>
        <input type="password" name="{$name}" class="{$class|default='layui-input'}" value="{$value}" {$other} />
    <elseif condition="$type eq 'textarea'"/>
        <textarea name="{$name}" class="{$class|default='layui-textarea'}" {$other}>{$value}</textarea>
    <elseif condition="$type eq 'datetime'"/>
        <input type="text" name="{$name}" class="{$class|default='layui-input'}" role="date" value="{$value}" {$other} readonly />
    </if>
</if>